"""
根据传入的名称以及config构建query analyse 处理类
"""
from query_analyse.base_query_analyse import BaseQueryAnalyse
from query_analyse.sim_word import SimWord


class QueryAnalyseFactory:
    @classmethod
    def create_service(cls, config):
        service = None
        if config["name"] == "base_query_analyse":
            service = BaseQueryAnalyse(config)
        elif config["name"] == "sim_word":
            service = SimWord(config)

        if not service:
            print("init query analyse service %s failed " % config["name"])
        return service

